package com.twu.biblioteca;

import java.util.ArrayList;
import java.util.List;

public class MovieLibrary {
    private static List<Movie> movieLibrary = new ArrayList<Movie>();

    public MovieLibrary() {
        movieLibrary.add(new Movie("Sholay", "1975", "Ramesh Sippy", "N/A"));
        movieLibrary.add(new Movie("Movie1", "2013", "Ramesh Sippy", "10"));
    }


    public String returnMovies() {
        String summery = "";
        String title = "Movie     Year     Director     Rating";
        String space = "     ";
        String separator = System.getProperty("line.separator");
        summery = summery + title + separator;
        for (Movie movie : movieLibrary) {
            summery = summery +
                    movie.getName() + space +
                    movie.getYear() + space +
                    movie.getDirector() + space +
                    movie.getRating() + separator;
        }
        return summery;
    }
}
